Next | Prev | Up | Top | Contents | Index
Performance Comparison
The data displayed in Figure 8-1 was collected on a 4-processor Challenge system under IRIX 5.3, using a test program that wrote approximately 250,000 bytes of binary data using a specified blocksize and one of three options:
- default: asynchronous buffered write
- synchronous writes (option O_SYNC)
- direct writes (option O_DIRECT)

Figure 8-1 : Effect of Blocksize on write() Performance
The values in Table 8-1reflect the total execution time for one run of the program, as reported by the time command (see the time(1) reference page).
Data on Which Figure 8-1 is Based
Blocksize | O_SYNC | O_DIRECT | Asynchronous |
---|
512 | 40.4 | 13.9 | 2.7 |
1024 | 25.3 | 8.5 | 2.6 |
2048 | 12.9 | 5.8 | 2.6 |
4096 | 8.5 | 4.4 | 2.6 |
8192 | 6.2 | 3.7 | 2.6 |
16384 | 5.0 | 3.4 | 2.6 |
32768 | 4.4 | 3.1 | 2.5 |
65536 | 4.1 | 3.0 | 2.5 |
200000 | 3.9 | 2.9 | 2.5 |
Blocksize was almost irrelevant for asynchronous writes, because the only delay was the time to switch to kernel mode and block-copy the data from the program buffer to a kernel buffer. The actual disk operations occurred asynchronously, in another CPU, and so are not reflected in the time output. As shown in Figure 8-1, O_DIRECT is considerably faster than O_SYNC.
Next | Prev | Up | Top | Contents | Index